// let string = 'hello'
// console.log(string.replace(/^/, '✨'));
// console.log(string.replace(/$/, '🤔'));

// let word = "hello_world_正则_表达式.js";
// console.log(word.replace(/\b/g, '❤️'));
// console.log(word.replace(/\B/g, '❤️'));
// console.log(word.replace(/(?=hello)/g, '❤️'));
// console.log(word.replace(/(?!hello)/g, '❤️'));
// console.log(word.replace(/(?<=hello)/g, '❤️'));
// console.log(word.replace(/(?<!hello)/g, '❤️'));

let price = '123456789';
let priceReg = /(?!^)(?=(\d{3})+$)/g;
console.log(price.replace(priceReg, ','));

let mobile = '18379836654';
const formatMobile = (mobile) => {
    return String(mobile).slice(0, 11)
        .replace(/(?<=\d{3})\d+/, ($0) => '-' + $0)
        .replace(/(?<=[\d-]{8})\d{1,4}/, ($0) => '-' + $0);
}
console.log(formatMobile(mobile));

let reg = /((?=.*\d)((?=.*[a-z])|(?=.*[A-Z])))|(?=.*[a-z])(?=.*[A-Z])^[a-zA-Z\d]{6,12}$/;

